home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / database / dg53.zip / DGOPS.SAM < prev    next >
Text File  |  1997-05-26  |  17KB  |  315 lines

  1.         -C         Case sensitive  (default is case insensitive).
  2.  
  3.         -c         Count only.  Report the number of records 
  4.                    containing the search phrase.
  5.  
  6.         -v         inVert sense.  Report records not containing 
  7.                    the search phrase.
  8.  
  9.         -d$        Use $ or other following char as Delimiter
  10.                    Exception:  Use -dd (yes - lower case d repeated)
  11.                    and the system will treat a blank line as the
  12.                    delimiter for search (sort of like considering
  13.                    paragraphs as records).  Output will, however,
  14.                    insert the standard "*" delimiter.
  15.  
  16.         -dd        Paragraph mode. Blank lines are record Delimiters.
  17.                    True blank lines only- no spaces or tabs.
  18.                    See -d above.
  19.  
  20.         -k[n]      Search in Keyword-lines-only. Declare the first n (1-9)
  21.                    lines as keyword-lines.  Default 1st line only.
  22.  
  23.         -K[n]      Limit output report to Keyword-lines-only.
  24.                    The first n (1-9) lines are Keyword-lines.  
  25.                    Default 1st line only.  n for -k and -K
  26.                    options limited to 1 digit.  They are 
  27.                    independent, and can be used together.
  28.  
  29.         -s         Status of data file: give record count only.
  30.                    If used with -V option, reports misc. file data.
  31.                    Ignores null records. (Reports them if verbose).
  32.                    (overrides other options on the command line)
  33.  
  34.         -l         Treat aLL records as hits. No searchterm needed.
  35.                    Useful with -D, -a, -A, -K options.
  36.                    dg -Kpl will give an undelimited list of
  37.                    first (key) lines. dg -Kplh# gives a similar
  38.                    list of major/minor keylines for files with
  39.                    major (*) records and sub(#)records. 
  40.                    Note- Other uses of -l and -h together are
  41.                    not recommended.
  42.  
  43.         -w         Match only on Words. (phrase bound by spaces 
  44.                    or line boundary or any non-alpha, non-digit)
  45.                    Underscore (_) is treated as part of a word.
  46.  
  47.         -u         Like -w but Underscore (_) is treated as a 
  48.                    word delimiter (as if whitespace) as well.
  49.  
  50.         -x         Search phrase is found even if it crosses over 
  51.                    a line boundary (X-over). One-line crossover 
  52.                    only. Ignores trailing but not leading 
  53.                    spaces on lines.  Best when used with -T 
  54.                    to ignore leading spaces too.  Note: trailing
  55.                    hyphens are also ignored so that normal word
  56.                    hyphenation is dealt with.
  57.  
  58.         -f         Get searchstrings from File.  
  59.                    Use filename to replace search phrase on the 
  60.                    command line.  Leading and trailing spaces in
  61.                    the file of phrases are stripped. For DOS, number of 
  62.                    searchstrings in the file is limited to 100 
  63.                    *and* a 20 character string size limit is imposed.
  64.                    Finds are reported in the order they occur in the 
  65.                    data file, not the order of the file of terms. 
  66.                    (use batch files/unix scripts if you must extract 
  67.                    records in other than data file order.) 
  68.  
  69.         -F[n]      The searchterm must be found in Field n of a
  70.                    line to be considered a hit.  Incompatible
  71.                    with -mMxnUD and ^$ usage.  A field of a line
  72.                    is defined as in a default awk usage-- words or 
  73.                    terms separated by whitespace, with leading/trailing 
  74.                    whitespace ignored.  Use -F with no numerics to 
  75.                    indicate the last field of a line regardless of
  76.                    the number of fields there.  See extended discussion
  77.                    below.
  78.  
  79.         -L         Affects -F option. Lax enforcement of field numbers
  80.                    and lengths.  See extended discussion below.
  81.  
  82.         -m[n]      Expect n Multiple search terms on the command line,
  83.                    each of which must be present on_a_single_line in a
  84.                    record to cause a find. If n is omitted, n=2.
  85.                    Incompatible with -v.  Max n is 9. If the searchterms
  86.                    are identical, 1 hit suffices.  If used with -x,
  87.                    finds must be within about 1 line of each other.
  88.  
  89.         -M[n]      Expect n Multiple search terms on the command line,
  90.                    each of which must be present somewhere_in_the_record 
  91.                    to cause a find. If n is omitted, n=2.
  92.                    Incompatible with -v.  Max n is 9.
  93.  
  94.         -E[n]      Look for Extras-- expect 1 search term on the command
  95.                    line, and report records having that term on at 
  96.                    least n separate lines. If n omitted, n=2.
  97.                    Incompatible with -v.  Looks for Extras.
  98.  
  99.         -p         Plain output.  Do not print the delimiter on output.
  100.                    Exception: with -y, kills only the sub-separator line.
  101.  
  102.         -e         Exact whole-line match required to cause a find.
  103.  
  104.         -T         Ignore L & R (lead/Trail) spaces on all lines. 
  105.                    Useful with  -e or -x                                        
  106.  
  107.         -Q         Quit on first find of term; on first find of *each* term
  108.                    when used with -f.  Useful with files that redundantly
  109.                    repeat records, e.g. expanded procedural flows. If more
  110.                    than one -f term is found in a record, all are satisfied
  111.                    by printing that record.  Do not confuse this with 
  112.                    -m or -M searches.  The -Q option then will quit on the
  113.                    first find satisfying the -m or -M condition.
  114.  
  115.         -W         Print only the record numbers where the finds occur.
  116.                    ("Which" records?)
  117.  
  118.         -h$        Use $ or other following char as an added, secondary 
  119.                    "Helper" delimiter. The secondary delimiter will be 
  120.                    recognized whether in the first or second position 
  121.                    on a line.  Output will be preceded by the first 
  122.                    line of the main record, and the phrase: "PARTIAL 
  123.                    RECORD:"  Not compatible with -x option.
  124.                    Exception:  Use -hh or terminal -h with no character
  125.                    specified, and the system will treat a virtual blank 
  126.                    line (true blank lines, or lines with only spaces/tabs)
  127.                    as a secondary delimiter for search (sort of like 
  128.                    considering paragraphs as sub-records within explicitly
  129.                    delimited records).  Output will, however, insert the 
  130.                    standard "*" delimiter. 
  131.                    Example:  dg -hhCF1 -h dgman
  132.                    will give help on the -h option of dg.
  133.  
  134.         -Dfname    Divide(distribute) output: 
  135.                    Write records found to files fname0001, fname0002...
  136.                    one file for each find. Supported ONLY as last option
  137.                    in the option list.  Limited to 9999 output files.
  138.  
  139.         -n#[...]   Get record by Number, e.g. -n456 = get 456th record
  140.                    Compatible ONLY with -vKqod$...  NOT with -aA
  141.                    Null records are ignored when counting.
  142.                    Supported ONLY as last option in the option list.
  143.                    A syntax of -n#[#####],#[#####] is supported to retrieve 
  144.                    a range of record numbers.  Particularly useful
  145.                    when a large file must be divided.
  146.  
  147.         -a         Print whole data file, Append contents of zzapfile 
  148.                    to finds. See discussion below: UPDATING RECORD STATUS
  149.  
  150.         -A         Print whole data file, Append zzapfile line 1 to 
  151.                    keyline 1 of finds. See discussion below: UPDATING 
  152.                    RECORD STATUS
  153.  
  154.         -j         Affects -a, -A options- don't print whole 
  155.                    file, but Just the records with finds.
  156.  
  157.         -J         Affects -a, -A options- tacks a "Jumped" record 
  158.                    number onto "found" records.
  159.  
  160.         -r         Print the delimiter followed by dashes (like a
  161.                    Ruler line) to enhance visual separation of records. 
  162.  
  163.         -R         Retain content of original delimiter lines.
  164.                    The default is to drop additional characters
  165.                    following the delimiter. (The default permits
  166.                    the delimiter line to contain "private" 
  167.                    file documentation.)
  168.  
  169.         -B         Fold-in Big data updates. Allows automated updates
  170.                    of large record sets based on a file of update
  171.                    directions.  Highly useful but only in limited
  172.                    circumstances.  See discussion below.
  173.  
  174.         -U         Uniqify a set of records. Directs deletion of 
  175.                    repeated records based solely on the last field of 
  176.                    the first keyline.  Limited filesizes except in
  177.                    UNIX versions. See extended discussion below. 
  178.  
  179.         -V         Verbose. Show prefatory/summary remarks.  Use 
  180.                    with -s for datafile status report. Use -Vq with
  181.                    dgw batch file to record filenames searched.
  182.  
  183.         -H         Emphasize the line in the record where the
  184.                    search conditions were met. Prints markers
  185.                    (happy faces if in DOS) at beginning of the 
  186.                    "Highlighted" line.  Seldom needed, but can be 
  187.                    helpful when individual records are long.
  188.  
  189.         -N         Print a Negative message if no records are found.
  190.                    Normally, there is no output when there are no 
  191.                    finds.
  192.  
  193.         -o         Null argument. Does nOthing. Useful from 
  194.                    some batch files/scripts. 
  195.  
  196.         -G         A Grep-like option. Only the lines with the
  197.                    match are printed.  Use only if a real grep is 
  198.                    unavailable. No REGEXP, but usable with the 
  199.                    following options: 
  200.                         -w, -u, -c, -v, -T, -C, -e, -f, -m, -F, -N, ^$
  201.                    Not usable with -k,-K,-x,-D,-Q,-y
  202.                    nor with most other options that are record-oriented.
  203.                    Inappropriate options are not all trapped, but 
  204.                    generally have no effect.
  205.  
  206.         -y         The grep-rest option. Unrelated to -G.
  207.                    "digs" for a record, Yet greps it too.
  208.                    Usable with -K such that IF a record is
  209.                    a "hit" the -K keylines are printed, and
  210.                    followed by any remaining lines in that record
  211.                    that contain one of a set of other searchterms.
  212.                    I.E.- print the keylines of finds and grep the
  213.                    rest of the record for other searchterms.
  214.                    The -m option and syntax must be used, but the
  215.                    the FIRST term given in -m syntax becomes the 
  216.                    SOLE record searchterm and all OTHER -m terms 
  217.                    become what we grep for after the keylines.
  218.                    Example:
  219.     
  220.                         dg -ykK2m3r gold melt boil elements
  221.     
  222.                    will print the 1st 2 keylines of records in the
  223.                    file "elements" having "gold" in the 1st keyline,
  224.                    and then print any remaining lines in the record 
  225.                    having the terms "melt" or "boil".  Use with 
  226.                    the -r option for best visual separation of 
  227.                    resultant records.
  228.  
  229.         -I         Ignore delimiter if repeated in place 2.
  230.                    i.e., if a line begins with ** then
  231.                    Treat it as just a text line, not a delimiter line.
  232.                    Useful with certain originals when you don't want
  233.                    to clean them up first.
  234.  
  235.         -S         Add delimiters (Stars) to a file. A delimiter line is
  236.                    added _before_ each line containing the search term.
  237.                    Use -Sf and a file of searchterms when appropriate.
  238.  
  239.         -P         Add delimiters (Post-stars) to a file. Like -S, 
  240.                    but delimiters are added _following_ each line 
  241.                    that is a hit.
  242.  
  243.         -q         Quiet.  No extraneous prefatory/summary remarks
  244.                    (default, but retained for historical reasons).
  245.                    Exception: Use -Vq with dgw batch file to record 
  246.                    filenames searched.
  247.  
  248.         -i[n]      Recognize an Indented delimiter anywhere in the first
  249.                    n characters (1-9) of a line.  Useful in delimiting
  250.                    code files when the delimiter must reside inside 
  251.                    a comment, e.g., 
  252.                    /* (c) , //* (c++) , #* (unix), ;* (lisp) , REM * (dos)
  253.                    Especially useful with -T to kill leading whitespace
  254.                    for files that have extensive indentation schemes.
  255.                    Thus a -Ti option allows #* to work with any amount
  256.                    of leading whitespace.
  257.  
  258.         -Z[Z][1]   FuZzy searches-- Look for approximate matches.     
  259.                    The -Z option uses a SOUNDEX algorithm that assumes
  260.                    the first letter of every word is unfuzzy. Use
  261.                    the -ZZ option to fuzz even the first letter,
  262.                    e.g., batter with a searchterm of "patter", but
  263.                    expect lots of false hits.  A Z1 option uses a stem
  264.                    algorithm that might find "silliness" when you 
  265.                    search for "silly". All three fuzzy approaches 
  266.                    are desperation moves, sometimes laughable.
  267.                    You may need the -H option to figure out which
  268.                    line caused the hit.  Expect "fuzzy" to be more
  269.                    like "hairy" or even "wooly" most of the time.
  270.        
  271.                    The SOUNDEX approach is an old classic, which gives 
  272.                    decent results when you must search with names or 
  273.                    commonly misspelled words such as nuclear and 
  274.                    personnel, but expect lots of extra drivel as well.  
  275.                    Only the first few syllables are checked.  If you're 
  276.                    curious, you can inspect the kind of coding produced 
  277.                    for any searchterm by adding a -N option using a 
  278.                    file you know will NOT produce a match.  The "not 
  279.                    found" report will show the soundex or stem code of 
  280.                    the searchterm.  Alternatively, add a -V verbose 
  281.                    option and wade through the whole mess. 
  282.        
  283.                    Expect junk results if you use small searchterms, 
  284.                    numeric searchterms, or searchterms that include 
  285.                    spaces or punctuation. The -w option is disallowed.  
  286.                    Although only words are really treated, there can be 
  287.                    no guarantee of a true wordmatch.  The -e option is 
  288.                    allowed, but a hit indicates exactness only in the 
  289.                    coding string, not in the actual text. All fuzzy 
  290.                    searches are automatically case-insensitive.
  291.  
  292.         -O         Show PrOgress-- when working very large files,
  293.                    print some sign of life every 1000 lines 
  294.                    to screen only.
  295.  
  296.         ^$         These are not command line options, but implied
  297.                    options nonetheless.  Though full unix regular 
  298.                    expressions are not supported, the ^ and $ 
  299.                    expressions are:
  300.      
  301.                           dg ^foo filename
  302.      
  303.                    means look for "foo" at the beginning of a line.
  304.      
  305.                    Similarly:
  306.                           foo$ means foo at the end of a line
  307.                           \^foo means search for literal "^foo"
  308.                           foo\$ means search for literal "foo$"
  309.                           Note that a search for ^RAT$ is designed to
  310.                              succeed on "RATCELLAR WITH RAT"
  311.                           Use -e for the unix sense of ^RAT$
  312.                              where the intent is SOL-phrase-EOL.
  313.  
  314.  
  315.